addpath('../lib');
addpath('../mockData');

disp('initial computations');


niter = 500;

t = 0:0.3:10; %laikas
lam = 100:1.4:700; %bangos ilgiai

disp(size(t));
disp(size(lam));

W = MockWGaussian(lam);
H = MockHSimple(t);

duomenys=W*H;

R = 3;
%% standart NMF
disp('Computing NMF');
rezD = [];
rezE = [];
for i=1:200,
    [W1 H1] = NMF(duomenys, R, niter);
    rezE = [rezE EuclidDistWH(W, H, W1, H1)];
    rezD = [rezD DivergWH(W, H, W1, H1)];
end

figure(1);
plot(rezE);
std(rezE)
mean(rezE)

figure(2);
plot(rezD);
std(rezD)
mean(rezD)
disp('Finished');
